﻿using System.Collections.Generic;
using BLL.Services.Books;

namespace Web.Models
{
    public class HomeModel
    {
        public HomeModel()
        {
            NewBooks = new List<NewBookModel>();
            BestBooks = new LinkedList<BookWithRating>();
        }

        public IEnumerable<NewBookModel> NewBooks { get; set; }

        public IEnumerable<BookWithRating> BestBooks { get; set; } 

        public class NewBookModel
        {
            public NewBookModel(Book book)
            {
                Avatar = book.Avatar;
                Id = book.BookId;
                Name = book.Name;
            }
            public int Id { get; set; }

            public string Name { get; set; }

            public string Avatar { get; set; }
        }
    }
}